package ThreadProjectTest.reentrant;

/*
 * Author: JacksonCoder
 * FileName: ReentrantLockExample
 * Version: 1.0.0
 */
public class ReentrantLockExample {
    public static void main(String[] args) {

        BankAccount account = new BankAccount(1000);

        //
        Thread t1 = new Thread(()-> {
            account.deposit(500);
            account.withdraw(200);
        },"线程1");

        Thread t2 = new Thread(()->{
            account.deposit(700);
            account.withdraw(600);
        },"线程2");

        // start
        t1.start();
        t2.start();

    }
}
